package com.qf.dao;

import com.qf.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserDao {
    @Select("select * from t_users")
    public List<User> findAll();
    public User findId(@Param("id") Integer id);
    public int insertUser(@Param("user") User user);
    public int findUpdateUser(@Param("user") User user);
    public int findDeleteUSer(@Param("id") Integer id);

    @Select("select * from t_users where id=#{id}")
    public User findId1(@Param("id") Integer id);
    @Insert("insert into t_users values (#{id},#{user.name},#{user.password},#{user.sex},#{user.birthday},#{user.registTime})")
    public int insertUser1(@Param("user") User user);
    @Update("update  t_users set(name=#{user.name},password=#{user.password},sex=#{user.sex},birthday=#{user.birthday}, registTime=#{user.registTime}) where id=#{user.id}")
    public int findUpdateUser1(@Param("user") User user);
    @Delete("delete from t_users where id=#{id}")
    public int findDeleteUSer1(@Param("id") Integer id);
}
